<template>
  <el-empty :description="desc" :image-size="166">
    <template #image>
      <img src="~img/empty-no-data.png" alt="">
    </template>
    <template #description>
      <slot name="desc">
        <p v-if="emptyType === ''">{{ desc }}</p>
        <p v-else-if="emptyType === 'NO_DATA'">暂无数据</p>
        <p v-else-if="emptyType === 'TO_QUESTION_STORE'" class="flex-center">暂无试题，<el-link target="_blank" style="text-decoration: underline;" :underline="false" :href="QUESTION_STORE_URL" type="primary">去试题库创建</el-link></p>
      </slot>
    </template>
  </el-empty>
</template>

<script setup>
defineProps({
  desc: {
    type: String,
    default: ' '
  },
  emptyType: {
    type: String,
    default: ''
  }
})
const QUESTION_STORE_URL = import.meta.env.VITE_APP_OLD_TLIAS_RESOURCE_URL_TO_MY_QUESTION
</script>

<style scoped lang="scss">
.svg-icon {
  font-size: 60px;
}
.el-empty {
  &:deep(.el-empty__description) {
    p {
      line-height: 1.5 !important;
    }
  }
}
</style>
